<%--
  Created by IntelliJ IDEA.
  User: 郑自航
  Date: 2018/10/16
  Time: 10:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>testMerch</title>
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <meta name="apple-touch-fullscreen" content="yes">
    <script src="/trade/static/js/flexible.56e687b9.js"></script>
    <link rel="stylesheet" href="/trade/static/css/wechatpay.a0f33de5.css"/>
    <script type="text/javascript" charset="utf-8">
        function pay_now() {
            document.getElementById('pay-now').style.display="none";

            WeixinJSBridge.call('hideOptionMenu');
            WeixinJSBridge.call('hideToolbar');
            WeixinJSBridge.invoke('getBrandWCPayRequest',{
                'package':'prepay_id=wx16105417384082630c0617c10749636565',
                'timeStamp':'1539658457',
                'signType':'RSA',
                'paySign':'y93tpYcfsIDJ o2dXRrVm9ef82TsY7YrLY8oVeNPVw9fLEekdQTzDXBOS7MPkLtKhJrt2YspeFyB9WnrzA ZJah5qF7CS26Au3lMcmql4r/RAuogh5ljec1SUWaYlfQykQntuMxVG1CLahS0xOsgK4ewepU2Bo7IL5qFW/R/91P4pddQokol/MGEaMyTEDaKkPC5RCcamJ0wh7SWRHiguTvDQHDltUCQDO41GwppI0lu5LJ3 /20sJC1mABAk5PwhMrevDf0EON6oz61cxX AX9UWfUhg 9FkPMIUpJHjWEX7KkqdFW/jm/HqJbF1wMn5xKgPK/jCbvqs9b7JQ4Yeg==',
                'appId':'wx8e5fd1605aef93f2',
                'nonceStr':'3e3dbce0490e4c01a76c0556222dfc7f'
            },function(res){
                if(res.err_msg == "get_brand_wcpay_request:ok"){
                    location.replace('https://o2.qfpay.com/q/direct');
                } else if(res.err_msg == "get_brand_wcpay_request:cancel"){
                    document.getElementById('pay-now').style.display=null;
                } else {
                    WeixinJSBridge.invoke('closeWindow',{},function(res){});
                }
            });
        }
        if (typeof WeixinJSBridge == "undefined") {
            if ( document.addEventListener ) {
                document.addEventListener('WeixinJSBridgeReady', pay_now, false);
            } else if (document.attachEvent) {
                document.attachEvent('WeixinJSBridgeReady', pay_now);
                document.attachEvent('onWeixinJSBridgeReady', pay_now);
            }
        } else {
            pay_now();
        }
    </script>
</head>
<body>
<div id="wrap">
    <div id="no-insert">
        <header>
            <h1>
                ￥0.01
            </h1>
        </header>
        <ul>
            <li>
                <div>
                    <i>收款方</i>
                    <p>testMerch</p>
                </div>
            </li>
            <li>
                <div>
                    <i>商品</i>
                    <p>testUnified收款</p>
                </div>
            </li>
        </ul>
        <a href="javascript:void(0)" id="pay-now" style="display:none" onclick="pay_now()">立即支付</a>
    </div>
</div>
</body>
</html>